<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="author" content="Jiang">
    <title>轮播</title>
    <link rel="stylesheet" href="./carousel.css">
</head>

<body>



    <div class="carousel" id="carousel">
    </div>
    
    <script src="./jquery.min.js"></script>
    <script src="./carousel.js"></script>
    <script>
        var opts = {
            index: 0,                               //开始显示的图片索引值
            carousleTime: 5000,                     //轮播图速度（ms）
            imgWidth: 800,                          //图片的宽度
            parentDom: ".carousel",                 //必传参数 父容器
            data: [                                 //必传参数 图片数据
                { href: "#", img: "images/1.jpg" },
                { href: "#", img: "images/2.jpg" },
                { href: "#", img: "images/3.jpg" },
                { href: "#", img: "images/4.jpg" },
                { href: "#", img: "images/5.jpg" },
            ],
        }
        var carousel = new Carousel(opts);
    </script>



</body>

</html>